package com.tanhua.manager.interceptor;

import com.tanhua.manager.domain.Admin;

/**
 * @author liuyp
 * @date 2021/02/20
 */
public class AdminHolder {
    private static ThreadLocal<Admin> adminTl = new ThreadLocal<>();
    private static ThreadLocal<String> tokenTl = new ThreadLocal<>();

    public static void setAdmin(Admin admin){
        adminTl.set(admin);
    }

    public static Admin getAdmin(){
        return adminTl.get();
    }

    public static void removeAdmin(){
        adminTl.remove();
    }

    public static void setToken(String token) {
        tokenTl.set(token);
    }

    public static String getToken(){
        return tokenTl.get();
    }

    public static void removeToken(){
        tokenTl.remove();
    }
}
